#ifndef DECLARATIVEENVIRONMENT_H
#define DECLARATIVEENVIRONMENT_H

#include <defs/export.h>
#include <defs/global.h>
#include <core/entityobject.h>
#include <QtCore>
#include <scripting/declarativeenvironment.h>

O_PRIVATE_DECLARE(DeclarativeEnvironmentEx);
class DeclarativeEnvironmentEx : public Opl::Scripting::DeclarativeEnvironment {
    Q_OBJECT
public:

	QDeclarativeItem* declarativeItem();
	QString errorString();
	bool initialize(const QUrl& url, bool newWindow/* = false*/);
	QObject* exec();
	void setUrl(const QUrl& url);
	void stop();
	void reload();
	void registerObject(const QString& name, Opl::Core::EntityObject* object, const QString& package = "");

	QObject* object()const;
	QDeclarativeComponent* component();

	DeclarativeEnvironmentEx(Opl::Core::EntityObject *parent = 0);
	virtual ~DeclarativeEnvironmentEx();
private:
	O_PRIVATE_DECLARE_MEMBER(DeclarativeEnvironmentEx)
};

#endif // DECLARATIVEENVIRONMENT_H

